package com.fms.gui.emailer.factory;

import com.fms.model.messaging.domain.IEmailData;
import com.fms.model.messaging.repo.IEmailDataRepository;

public class EmailDataFactory implements IEmailDataRepository
{
	
	private IEmailDataRepository	repo;
	private static IEmailData current = null;

	public EmailDataFactory(IEmailDataRepository _repo)
	{
		this.repo = _repo;
	}

	public void save(IEmailData data)
	{
		repo.save(data);
		
	}

	@Override
	public IEmailData load()
	{
		if(current == null)
		{
			current = repo.load();
		}		
		return current;
	}

}
